<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "user_auth_record".
 *
 * @property int $id
 * @property int $user_id 用户id
 * @property string $name 用户手机号
 * @property string $phone 用户姓名
 * @property int $company_id 企业id
 * @property int $audit_status 审核状态
 * @property string $remark 审核备注
 * @property int $status 状态
 * @property int $created_at 创建时间
 */
class UserAuthRecord extends Base
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'user_auth_record';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['user_id', 'company_id', 'audit_status', 'status', 'created_at'], 'integer'],
            [['remark'], 'string'],
            [['name', 'phone'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user_id' => 'User ID',
            'name' => 'Name',
            'phone' => 'Phone',
            'company_id' => 'Company ID',
            'audit_status' => 'Audit Status',
            'remark' => 'Remark',
            'status' => 'Status',
            'created_at' => 'Created At',
        ];
    }

    public function getUser(){
        return $this->hasOne(User::class, ['id' => 'user_id']);
    }

    public function getCompanyInfo(){
        return $this->hasOne(CompanyInfo::class, ['id' => 'company_id']);
    }
}
